
<%@ page import="fiszkas.Fiszka" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'fiszka.label', default: 'Fiszka')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#list-fiszka" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
                <li><g:link class="delete" action="removeAll"><g:message code="default.button.deleteAll.label" args="[entityName]" /></g:link></li>
                <li><g:link class="save" action="resetAll"><g:message code="default.button.resetAll.label" args="[entityName]" /></g:link></li>
			</ul>
		</div>
		<div id="list-fiszka" class="content scaffold-list" role="main">
			<h1><g:message code="default.list.label" args="[entityName]" /> (${fiszkaInstanceCount})</h1>
			<g:if test="${flash.message}">
				<div class="message" role="status">${flash.message}</div>
			</g:if>
			<table>
			<thead>
					<tr>

                        <g:sortableColumn property="id" title="${message(code: 'fiszka.id.label', default: 'Id')}" />
					
						<g:sortableColumn property="box" title="${message(code: 'fiszka.box.label', default: 'Box')}" />
					
						<g:sortableColumn property="english" title="${message(code: 'fiszka.english.label', default: 'EN')}" />

                        <g:sortableColumn property="polish" title="${message(code: 'fiszka.polish.label', default: 'PL')}" />

                        <g:sortableColumn property="synonims" title="${message(code: 'fiszka.polish.label', default: 'S')}" />

                        <g:sortableColumn property="hits" title="${message(code: 'fiszka.succs.label', default: '#')}" />

                        <g:sortableColumn property="succs" title="${message(code: 'fiszka.succs.label', default: '+')}" />
					
						<g:sortableColumn property="fails" title="${message(code: 'fiszka.fails.label', default: '-')}" />
					
						<g:sortableColumn property="lastPracticed" title="${message(code: 'fiszka.lastPracticed.label', default: 'Last')}" />

					</tr>
				</thead>
				<tbody>
				<g:each in="${fiszkaInstanceList}" status="i" var="fiszkaInstance">

					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}"
                        onclick="document.location='<g:createLink action="show" id="${fiszkaInstance.id}" />'"
                        style="cursor: pointer">
						<td>${fieldValue(bean: fiszkaInstance, field: "id")}</td>

                        <td>${fieldValue(bean: fiszkaInstance, field: "box")}</td>

						<td>${fieldValue(bean: fiszkaInstance, field: "english")}</td>

                        <td>${fieldValue(bean: fiszkaInstance, field: "polish")}</td>

                        <td>${fieldValue(bean: fiszkaInstance, field: "synonims")}</td>

                        <td>${fieldValue(bean: fiszkaInstance, field: "hits")}</td>

                        <td>${fieldValue(bean: fiszkaInstance, field: "succs")}</td>
					
						<td>${fieldValue(bean: fiszkaInstance, field: "fails")}</td>
					
						<td><g:formatDate format="dd.MM" date="${fiszkaInstance.lastPracticed}" /></td>
					</tr>

				</g:each>
				</tbody>
			</table>
			<div class="pagination">
				<g:paginate total="${fiszkaInstanceCount ?: 0}" />
			</div>
		</div>
	</body>
</html>
